package com.iclient.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.iclient.dao.ext.PageModel;
import com.iclient.dao.model.SinaWbUser;
import com.iclient.dao.service.SinaWbUserService;

@Controller
public class SinaUserController {

	@Autowired
	private SinaWbUserService sinaWbUserService;
	
	@RequestMapping(value="/sina/user/index.html")
	public String index(){
		return "sina/index";
	}
	
	@RequestMapping(value="/sina/user/list.json")
	@ResponseBody
	public PageModel<SinaWbUser> list(Integer page, Integer rows){
		System.out.println(page);
		if(null == page){
			page = 1;
		}
		if(rows == null){
			rows = 20;
		}
		PageModel<SinaWbUser> pageModel = sinaWbUserService.findByPage(page, rows);
		return pageModel;
	}
	
}
